package at.fhooe.engine.visuals;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;


public class CircleVisual implements Visual {
	
	private Color m_color;
	private int m_size;
	private boolean m_fill;
	private Point2D m_position;
	
	public CircleVisual(Color color, int size, boolean fill) {
		this(color, size, 0, 0, fill);
	}

	public CircleVisual(Color color, int size, double positionX, double positionY, boolean fill) {
		m_color = color;
		m_size = size;
		m_fill = fill;
		m_position = new Point2D.Double(positionX, positionY);
	}
	
	//The circle has its center at the current position
	public void draw(Graphics2D graphics) {
		graphics.setColor(m_color);
		if(m_fill) {
			graphics.fillArc((int)m_position.getX() - m_size / 2, (int)m_position.getY() - m_size / 2, m_size, m_size, 0, 360);
		} else {
			graphics.drawArc((int)m_position.getX() - m_size / 2, (int)m_position.getY() - m_size / 2, m_size, m_size, 0, 360);
		}
	}

}
